package com.cc.controller;

import com.cc.entity.User;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("users")
public class UserRestController {
    //新增用户 post
    @PostMapping("addUser")
    public String addUser(@RequestBody User user){
        return "新增用户";
    }
    //修改用户 put
    @PutMapping
    public String updateUser(@RequestBody User user){
        return "修改用户";
    }
    //删除用户 delete
    @DeleteMapping("/{userId}")
    public String deleteUser(@PathVariable Integer userId){
        return "删除用户";
    }
    //查询 get
    @GetMapping
    public List<User> getList(){
        System.out.println("获取全部结果集");
        return null;
    }
    @GetMapping("/{id}")
    public User getUserInfo(@PathVariable Integer userId){
        System.out.println("返回单个用户信息====>"+userId);
        return null;
    }
}
